<?php
Util::tsRegisterAssetJs('admin_estudiante/admin_esturiantes.js');

/** @var ReclamoController $this */
/** @var Reclamo $model */
$this->breadcrumbs = array(
    'Reclamos' => array('index'),
    Yii::t('AweCrud.app', 'Manage'),
);
?>
<br>
<div class="main-box clearfix">
    <header class="main-box-header clearfix">
        <h2 class="pull-left"><?php echo Yii::t('AweCrud.app', 'Manage') ?> <?php echo Reclamo::label(2) . ' ' ?> </h2>
    </header>
    <div class="main-box-body clearfix">
        <div class="row">
            <div class="col-md-3">
                <select id="ddl_estado" class="form-control" >
                    <option value>- ESTADO (TODOS) -</option>
                    <?php
                    foreach (Reclamo_Constants::$estados as $estado) {
                        echo '<option value="' . $estado['value'] . '">' . $estado['value'] . '</option>';
                    }
                    ?>
                </select>
            </div>
        </div>
        <?php
        $this->widget('booster.widgets.TbGridView', array(
            'id' => 'reclamo-grid',
            'type' => 'striped table-responsive condensed',
            'dataProvider' => $dataProvider,
            'columns' => array(
                'asunto',
                array(
                    'name' => 'estado',
                    'type' => 'raw',
                    'value' => '$data->estadoLabel'
                ),
                array(
                    'name' => 'calificacion',
                    'type' => 'raw',
                    'value' => '$data->calificacionLabel'
                ),
                array('class' => 'booster.widgets.TbButtonColumn',
                    'template' => '{resolt} {view}',
                    'buttons' => array(
                        'resolt' => array(
                            'label' => 'Calificar',
                            'icon' => 'fa fa-check',
                            'url' => '"reclamos/reclamo/ajaxCalificar/id/".$data->id',
                            'imageUrl' => false,
                            'click' => 'js:function(){viewModal($(this).attr("href"),function(){});return false;}',
                            'visible' => '$data->estado == Reclamo_Constants::ESTADO_RESUELTO && Util::checkAccess(array("action_reclamo_ajaxCalificar"))'
                        ),
                        'view' => array(
                            'label' => 'Ver',
                            'icon' => 'fa fa-search',
                            'url' => '"reclamos/reclamo/view/id/".$data->id',
                            'imageUrl' => false,
                            'click' => 'js:function(){viewModal($(this).attr("href"),function(){});return false;}',
                            'visible' => '$data->estado == Reclamo_Constants::ESTADO_CALIFICADO && Util::checkAccess(array("action_reclamo_view"))'
                        ),
                    ),
                ),
            ),
        ));
        ?>
    </div>
</div>
